package top.wu2020.lazy.ws.chat.controller;

import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.wu.framework.web.spring.EasyController;
import org.springframework.web.bind.annotation.*;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import org.springframework.beans.factory.annotation.Autowired;
import jakarta.annotation.Resource;
import top.wu2020.lazy.ws.chat.domain.model.community.like.record.CommunityLikeRecord;
import top.wu2020.lazy.ws.chat.application.command.community.like.record.CommunityLikeRecordRemoveCommand;
import top.wu2020.lazy.ws.chat.application.command.community.like.record.CommunityLikeRecordStoryCommand;
import top.wu2020.lazy.ws.chat.application.command.community.like.record.CommunityLikeRecordUpdateCommand;
import top.wu2020.lazy.ws.chat.application.command.community.like.record.CommunityLikeRecordQueryListCommand;
import top.wu2020.lazy.ws.chat.application.command.community.like.record.CommunityLikeRecordQueryOneCommand;
import top.wu2020.lazy.ws.chat.application.CommunityLikeRecordApplication;
import top.wu2020.lazy.ws.chat.application.dto.CommunityLikeRecordDTO;
import java.util.List;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
/**
 * describe community_like_record 
 *
 * @author Jia wei Wu
 * @date 2024/05/24 08:52 晚上
 * @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyController 
 **/
@Tag(name = "提供者")
@EasyController("/community/like/record")
public class CommunityLikeRecordProvider  {

    @Resource
    private CommunityLikeRecordApplication communityLikeRecordApplication;

    /**
     * describe 新增
     *
     * @param communityLikeRecordStoryCommand 新增     
     * @return {@link Result<CommunityLikeRecord>} 新增后领域对象     
     
     * @author Jia wei Wu
     * @date 2024/05/24 08:52 晚上
     **/

    @Operation(summary = "新增")
    @PostMapping("/story")
    public Result<CommunityLikeRecord> story(@RequestBody CommunityLikeRecordStoryCommand communityLikeRecordStoryCommand){
        return communityLikeRecordApplication.story(communityLikeRecordStoryCommand);
    }
    /**
     * describe 批量新增
     *
     * @param communityLikeRecordStoryCommandList 批量新增     
     * @return {@link Result<List<CommunityLikeRecord>>} 新增后领域对象集合     
     
     * @author Jia wei Wu
     * @date 2024/05/24 08:52 晚上
     **/

    @Operation(summary = "批量新增")
    @PostMapping("/batchStory")
    public Result<List<CommunityLikeRecord>> batchStory(@RequestBody List<CommunityLikeRecordStoryCommand> communityLikeRecordStoryCommandList){
        return communityLikeRecordApplication.batchStory(communityLikeRecordStoryCommandList);
    }
    /**
     * describe 更新
     *
     * @param communityLikeRecordUpdateCommand 更新     
     * @return {@link Result<CommunityLikeRecord>} 领域对象     
     
     * @author Jia wei Wu
     * @date 2024/05/24 08:52 晚上
     **/

    @Operation(summary = "更新")
    @PutMapping("/updateOne")
    public Result<CommunityLikeRecord> updateOne(@RequestBody CommunityLikeRecordUpdateCommand communityLikeRecordUpdateCommand){
        return communityLikeRecordApplication.updateOne(communityLikeRecordUpdateCommand);
    }
    /**
     * describe 查询单个
     *
     * @param communityLikeRecordQueryOneCommand 查询单个     
     * @return {@link Result<CommunityLikeRecordDTO>} DTO对象     
     
     * @author Jia wei Wu
     * @date 2024/05/24 08:52 晚上
     **/

    @Operation(summary = "查询单个")
    @GetMapping("/findOne")
    public Result<CommunityLikeRecordDTO> findOne(@ModelAttribute CommunityLikeRecordQueryOneCommand communityLikeRecordQueryOneCommand){
        return communityLikeRecordApplication.findOne(communityLikeRecordQueryOneCommand);
    }
    /**
     * describe 查询多个
     *
     * @param communityLikeRecordQueryListCommand 查询多个     
     * @return {@link Result<List<CommunityLikeRecordDTO>>} DTO对象     
     
     * @author Jia wei Wu
     * @date 2024/05/24 08:52 晚上
     **/

    @Operation(summary = "查询多个")
    @GetMapping("/findList")
    public Result<List<CommunityLikeRecordDTO>> findList(@ModelAttribute CommunityLikeRecordQueryListCommand communityLikeRecordQueryListCommand){
        return communityLikeRecordApplication.findList(communityLikeRecordQueryListCommand);
    }
    /**
     * describe 分页查询多个
     *
     * @param communityLikeRecordQueryListCommand 分页查询多个     
     * @return {@link Result<LazyPage<CommunityLikeRecordDTO>>} 分页DTO对象     
     
     * @author Jia wei Wu
     * @date 2024/05/24 08:52 晚上
     **/

    @Operation(summary = "分页查询多个")
    @GetMapping("/findPage")
    public Result<LazyPage<CommunityLikeRecordDTO>> findPage(@Parameter(description ="分页大小") @RequestParam(defaultValue = "10", value = "size") int size,
                           @Parameter(description ="当前页数") @RequestParam(defaultValue = "1", value = "current") int current,@ModelAttribute CommunityLikeRecordQueryListCommand communityLikeRecordQueryListCommand){
        return communityLikeRecordApplication.findPage(size,current,communityLikeRecordQueryListCommand);
    }
    /**
     * describe 删除
     *
     * @param communityLikeRecordRemoveCommand 删除     
     * @return {@link Result<CommunityLikeRecord>}      
     
     * @author Jia wei Wu
     * @date 2024/05/24 08:52 晚上
     **/

    @Operation(summary = "删除")
    @DeleteMapping("/remove")
    public Result<CommunityLikeRecord> remove(@ModelAttribute CommunityLikeRecordRemoveCommand communityLikeRecordRemoveCommand){
        return communityLikeRecordApplication.remove(communityLikeRecordRemoveCommand);
    }
}